<template>
  <div class="main">
    <div class="left">
      <div class="top-button">
        <a-button-group>
          <a-button :type="proxyType ? 'default' : 'primary'" @click="proxyType = 0">智能代理</a-button>
          <a-button :type="proxyType ? 'primary' : 'default'" @click="proxyType = 1">
            全局代理
          </a-button>
        </a-button-group>
        <a-tooltip placement="top">
          <template slot="title">
            <span>智能代理：将只代理国外地区 | 全局代理：大陆地区依然使用代理</span>
          </template>
          <a-icon type="question-circle" style="margin-left: 10px;"/>
        </a-tooltip>
      </div>
      <div class="divider"></div>
      <div>
        <a-button shape="circle" @click="refreshNode" style="margin: 20px;">
          <a-icon type="sync" :spin="refresh"/>
        </a-button>
        <a-select default-value="v2ray-Hong Kong 01" style="width: 376px">
          <a-select-option value="v2ray-Hong Kong 01">
            <a-tag color="#87d068">
              畅通
            </a-tag>
            v2ray-Hong Kong 01
          </a-select-option>
          <a-select-option value="v2ray-Japen 01">
            <a-tag color="#87d068">
              畅通
            </a-tag>
            v2ray-Japen 01
          </a-select-option>
        </a-select>
        <a-button shape="circle" style="margin-left: 10px;">
          <a-icon type="thunderbolt"/>
        </a-button>
      </div>
      <div class="progress-ball">
        <div class="progress-ball-content">
          <div class="left-amount">剩余：96.26GB</div>
          <div class="total">96%</div>
        </div>
      </div>
      <div class="start-button">
        <a-button v-show="!isStart" @click="isStart = true" type="primary" shape="round" style="width: 230px;">启动连接</a-button>
        <a-button v-show="isStart" @click="isStart = false" type="danger" shape="round" style="width: 230px;">关闭连接</a-button>
      </div>
    </div>
    <div class="right">
      <div class="account-info">
        <div class="title">账户余额</div>
        <div class="value">
          <img src="@/assets/yue.png" alt="">
          <span style="margin-left: 5px;">0.00</span>
        </div>
      </div>
      <div class="account-info">
        <div class="title">会员等级</div>
        <div class="value">
          <img src="@/assets/viplevel.png" alt="">
          <span style="margin-left: 5px;">Lite会员</span>
        </div>
      </div>
      <div class="account-info">
        <div class="title">等级过期</div>
        <div class="value">
          <img src="@/assets/expire.png" alt="">
          <span style="margin-left: 5px;">2022-01-16</span>
        </div>
      </div>
      <div class="divider"></div>
      <div class="func-button">
        <a-button>
          <a-icon type="right-circle" style="color: white"/>最新官网
        </a-button>
      </div>
      <div class="func-button">
        <a-button>
          <a-icon type="right-circle" style="color: white"/>购买套餐
        </a-button>
      </div>
      <div class="func-button2">
        <a-button>
          <a-icon type="right-circle" style="color: white"/>邀请返利
        </a-button>
      </div>
    </div>
  </div>
</template>

<script>
import './right.css'
export default {
  name: 'Accelerate',
  data () {
    return {
      proxyType: 0,
      refresh: false,
      isStart: false
    }
  },
  methods: {
    refreshNode () {
      this.refresh = true
      setTimeout(() => {
        this.refresh = false
      }, 3000)
    }
  }
}
</script>

<style scoped>
.main {
  display: flex;
}

.left {
  width: 519px;
  height: 480px;
  background-color: #fff;
}

.right {
  margin-left: 14px;
  width: 170px;
  height: 480px;
  background-color: #fff;
}

.top-button {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider {
  border: 1px dashed #f0f0f0;
  width: 90%;
  margin: auto;
  transform: scaleY(0.5);
}

/deep/ .ant-select-selection__rendered {
  display: flex;
  justify-content: center;
}

.progress-ball {
  width: 120px;
  height: 120px;
  border: 2px solid #1890ff;
  position: relative;
  border-radius: 50%;
  transform: scale(1.4);
  margin: auto;
  margin-top: 50px;
}

.progress-ball::before {
  content: '';
  width: 62px;
  height: 120px;
  left: -2px;
  top: -2px;
  position: absolute;
  background-color: white;
  animation: miaobian2 4s linear;
  animation-fill-mode: forwards;
}

.progress-ball::after {
  content: '';
  width: 60px;
  height: 120px;
  left: 60px;
  top: -2px;
  position: absolute;
  background-color: white;
  animation: miaobian 2s ease-out;
  animation-fill-mode: forwards;
}

.progress-ball-content{
  background-image: linear-gradient(#e7f3ff, #1e93ff);
  width: 100%;
  height: 100%;
  z-index: 999;
  position: relative;
  border-radius: 50%;
}

.progress-ball-content::after{
  content: '';
  height: 100%;
  width: 100%;
  background-color: #fff;
}

.left-amount{
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 0.6rem;
  color: #6b7c8c;
}

.total{
  position: absolute;
  top: 40px;
  left: 40px;
  font-size: 1.2rem;
  font-weight: bold;
}

@keyframes toUp {
  0% {
    top: 120px;
    height: 0;
  }

  100% {
    top: 0;
    height: 120px;
  }
}

@keyframes miaobian {
  0% {
    width: 60px;
    height: 120px;
  }

  50% {
    height: 60px;
  }

  100% {
    top: 120px;
    height: 0;
  }
}

@keyframes miaobian2 {
  50% {
    width: 60px;
    height: 120px;
  }

  75% {
    height: 60px;
  }

  100% {
    height: 0;
  }
}

.start-button{
  position: relative;
  top:60px;
  text-align: center;
}

</style>
